<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="com.mvc.security.model.Menu"%>
<%@ include file="/pages/common/header.jsp"%>
</head>
<body>
    <div class="contentBody contentborder">
        <div class="tab-pane" id="tabPane">
            <div id="message"><%=message %></div>
            <div class="tab-page" id="tabPage1">
                <h1 class="tab">营业额成本表</h1>
                <div class="contentborder eXtremeTable">
                    <jdf:form bean="request" scope="request">
                        <form action="${dynamicDomain}/finance/summarySale" method="post">
                            <table class="inputTable">
                                <tr>
                                    <td nowrap class="label cancelBorderLeft">
                                        <label for="companyId">公司：</label>
                                    </td>
                                    <td class="content">
                                        <select id="companyId" name="companyId" style="width: 350px">
		                                    <jdf:selectCollection items="companies" optionValue="objectId" optionText="name"/>
		                                </select>
                                    </td>
                                    <td nowrap class="label">
                                        <label for="search_GED_beginDate">统计时间：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" id="search_GED_beginDate" size="12" name="search_GED_beginDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'search_LED_endDate\')}',readOnly:true})">
                                        ~
                                        <input type="text" id="search_LED_endDate" size="12" name="search_LED_endDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'search_GED_beginDate\')}',readOnly:true})">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="bottomLabel" nowrap colspan="4">
                                        <div class="right">
                                            <button type="submit">统计</button>
                                        </div>
                                    </td>
                                </tr>
                             </table>
                        </form>
                    </jdf:form>
                    <table style="width: 100%;" class="tableRegion">
                        <tr>
                            <td class="tableHeader" style="width: 10%">
                                <label>货币</label>
                            </td>
                            <td class="tableHeader" style="width: 10%">
                                <label>汇率</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>订单金额</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>兑换人民币金额</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>采购金额</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>兑换人民币金额</label>
                            </td>
                        </tr>
                        <tbody class="tableBody" >
                        <c:forEach varStatus="num" var="item" items="${datas}">
                        <tr class="${num.index % 2 == 0 ? 'even' : 'odd'}"  onmouseover="this.className='highlight'"  onmouseout="this.className='${num.index % 2 == 0 ? 'even' : 'odd'}'">
                            <td>
                                ${item.remark}<form action="${dynamicDomain}/finance/saveCurrency">
                            </td>
                            <td>
                                ${item.quantity}
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.salesCondition}" pattern="#,###.###"/>
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.salesCondition*item.quantity}" pattern="#,###.###"/>
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.shipment}" pattern="#,###.###"/>
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.shipment * item.quantity}" pattern="#,###.###"/>
                            </td>
                        </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    
                    <table style="width: 100%;" class="tableRegion">
                        <tr>
                            <td class="tableHeader" style="width: 10%">
                                <label>货币</label>
                            </td>
                            <td class="tableHeader" style="width: 10%">
                                <label>汇率</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>快递金额</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>兑换人民币金额</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>办公费用</label>
                            </td>
                            <td class="tableHeader" style="width: 20%">
                                <label>兑换人民币金额</label>
                            </td>
                        </tr>
                        <tbody class="tableBody" >
                        <c:forEach varStatus="num" var="item" items="${datas}">
                        <tr class="${num.index % 2 == 0 ? 'even' : 'odd'}"  onmouseover="this.className='highlight'"  onmouseout="this.className='${num.index % 2 == 0 ? 'even' : 'odd'}'">
                            <td>
                                ${item.remark}<form action="${dynamicDomain}/finance/saveCurrency">
                            </td>
                             <td>
                                ${item.quantity}
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.clientPo}" pattern="#,###.###"/>
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.clientPo*item.quantity}" pattern="#,###.###"/>
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.payment}" pattern="#,###.###"/>
                            </td>
                            <td>
                                <fmt:formatNumber value="${item.payment*item.quantity}" pattern="#,###.###"/>
                            </td>
                        </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <table style="width: 100%;" class="tableRegion">
                        <tr class="tableHeader" >
                            <td colspan="6">
                                <h1 class="tab">人民币汇总（销售和采购以最后审核日期为统计日期，办公费用以实际付款日期为统计日期）</h1>
                            </td>
                        </tr>
                        <tr>
                            <td class="tableHeader" style="width: 10%">
                                <label>总订单(${orderCount})</label>
                            </td>
                            <td class="tableHeaderText" style="width: 25%;">
                                <label><fmt:formatNumber value="${totalSale}" pattern="#,###.###"/></label>
                            </td>
                            <td class="tableHeader" style="width: 10%">
                                <label>总采购(${purchaseCount})</label>
                            </td>
                            <td class="tableHeaderText" style="width: 25%">
                                <label><fmt:formatNumber value="${totalPurchase}" pattern="#,###.###"/></label>
                            </td>
                            <td class="tableHeader" style="width: 10%">
                                <label>总杂费(${expenceCount})</label>
                            </td>
                            <td class="tableHeaderText" style="width: 25%">
                                <label><fmt:formatNumber value="${totalExpense}" pattern="#,###.###"/></label>
                            </td>
                        </tr>
                        <tr>
                            <td class="tableHeader" style="width: 10%">
                                <label>毛利润</label>
                            </td>
                            <td class="tableHeaderText" colspan="5">
                                <label><fmt:formatNumber value="${total}" pattern="#,###.###"/></label>
                            </td>
                        </tr>
                     </table>
                </div>
            </div>
        </div>
    </div>
</html>